package com.c6906.vdam.das.common;

/**
 * @Author : TAOHUIQI @Date: 2024/7/28 14:24 @Description:
 */
public enum DataStatusEnum {
    ANT_OPEN(1, "GNSS天线开路"), ANT_SHORT(2, "GNSS天线短路"), NO_VOL(3, "模块掉电"), OFF_LINE(4, "离线状态"), OVER_SPEED(5,
            "超速驾驶"), TIRED_DRIVE(6, "疲劳驾驶"), GNSS_ERROR(7, "GNSS模块状态"), UNDER_VOL(8, "终端欠压状态");

    private int code;

    private String name;

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    DataStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(int code) {
        for (DataStatusEnum dataStatusEnum : values()) {
            if (dataStatusEnum.getCode() == code) {
                return dataStatusEnum.name;
            }
        }
        return null;
    }
}
